import request from '@/utils/request'
import { ADMIN } from '@/config/baseUrl'

/**
 * 获取登陆用户信息
 * @returns
 */
export function getUseLoginByUsernameApi() {
  return request({
    url: `${ADMIN}/getUserInfo`,
    method: 'get'
  })
}

/**
 * 登出
 * @returns
 */
export function logoutApi() {
  return request({
    url: `${ADMIN}/logout`,
    method: 'delete'
  })
}

/**
 * 获取菜单
 * @returns
 */
export function getMenusApi() {
  return request({
    url: `${ADMIN}/getRouters`,
    method: 'get'
  })
}


/**
 * 获取token
 * @param code 
 * @returns 
 */
export function getTokenApi(code) {
  return request({
    url: `${ADMIN}/loginIDaas`,
    method: 'post',
    data: {
      code
    }
  })
}